(module woof-main mzscheme
  (require "woof-machine.scm")
  (require "woof-kernel.scm")
  (require (lib "cmdline.ss"))
  (require (lib "file.ss"))

  (define debug-mode #f)
  (define bytecode-mode #f)
  
  (let* ((filename
	  (command-line "woof.exe" (current-command-line-arguments)
			(once-each
			 [("-d" "--debug") "Print verbose debug info from the VM." (set! debug-mode #t)]
			 [("-b" "--bytecode-mode") "Accept raw bytecode as input." (set! bytecode-mode #t)]
			 )
			(args (filename)  filename)))
	 (full-path-name (resolve-path filename)))
    
    (if (file-exists? full-path-name)
	(if (not bytecode-mode)
	    (eval-woof-from-filename-with-prelude full-path-name #:debug debug-mode)
	    (eval-woof-bytecode-from-filename full-path-name #:debug debug-mode))
	(raise (string-append "Input file could not located:" full-path-name))))
  
)
